Skip to content

db created, more left to fix.#7

Open
ezotic wants to merge 29 commits into
code-differently:mainfrom
ezotic:main
Open

db created, more left to fix.#7
ezotic wants to merge 29 commits into
code-differently:mainfrom
ezotic:main

Conversation

@ezotic
Copy link
Copy Markdown

@ezotic ezotic commented Mar 1, 2021

No description provided.

Copy link
Copy Markdown
Contributor

@kburd kburd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid solution!

Comment thread data/createTables.js
@@ -0,0 +1,40 @@
const mysql = require('mysql');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend creating your schema with a sql script. You can run the script whenever you want to recreate your database

Comment thread data/index-json.js Outdated
app.use(cors())
const port = 4000

app.get('/all/:count', async (req, response) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add this logic to rest/index.js. You only want to create one express app

Comment thread data/schema.sql
);

CREATE TABLE types(
id INT PRIMARY KEY NOT NULL,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend using auto increment here as well

Comment thread rest/index.js
const port = 4000

app.get('/', (req, res) => {
res.send('Hello World!')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test route :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants